import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from 'path';
const baseSrc = path.resolve(__dirname, './src');
export const proxyUrl = "http://localhost:44306"
// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(),

  ],
  resolve: {
    alias: [
      {
        find: "~@",
        replacement: baseSrc,
      },
      {
        find: "~",
        replacement: baseSrc,
      },
      {
        find: "@",
        replacement: baseSrc,
      },
    ]
  },
  css: {
    preprocessorOptions: {
      scss: { api: 'modern-compiler' },
      less: {
        modifyVars: {
          'arcoblue-6': '#f85959',
        },
        javascriptEnabled: true,
      }
    }
  },
  server: {
    host: "0.0.0.0",
    port: 4200,
    proxy: {
      "/api": {
        target: proxyUrl,
        changeOrigin: true,
        secure: false,
        ws: true,
      },
      "/connect": {
        target: 'http://localhost:44306',
        changeOrigin: true,
        secure: false,
      },
      "/upload": {
        target: proxyUrl,
        changeOrigin: true,
        secure: false,
      },
    },
  },
})
